<div class="page has-sidebar-left  height-full">
  <header class="blue accent-3 relative">
        <div class="container-fluid text-white">
            <div class="row p-t-b-10 ">
                <div class="col">
                    <h4>
                        <i class="icon-user"></i> 用户管理 
                    </h4>
                </div>
            </div>
            <div class="row">
                <ul class="nav responsive-tab nav-material nav-material-white">
                    
                    
                <li> <a class="nav-link "  href="{:url('vip/index')}" ><i class="icon icon-drivers-license"></i>用户列表</a> </li>
                <li> <a class="nav-link "  href="{:url('user/index')}" ><i class="icon icon-drivers-license"></i>代理列表</a> </li>
                  <li><a class="nav-link active"><i class="icon icon-edit"></i> 用户信息修改</a></li>
              </ul>
            </div>
        </div>
    </header>
  
  
  
  
    <div class="container-fluid animatedParent animateOnce">
        <div class="animated fadeInUpShort go">
          <div class="container-fluid my-3">
            <div class="row">
                <div class="col-md-7 ">
                         <form role="form" id="form1" method="post" action="{:url('vip/update')}" >
                           
                        <div class="card no-b  no-r">
                            <div class="card-body">
                                <div class="form-row">
                                    <div class="col-md-8">
                                      
                                      
                                      
                                        <div class="form-group m-0">
                                            <label for="name" class="col-form-label s-12">
                                              编辑账户 ：    <span class="badge badge-dark"><i class="icon-user"> </i>  {$data.username}  </span>  </label>
                                            <input   type="hidden" class="form-control r-0 light s-12 " type="text"  name="name" value="{$data.username}"  data-validate="required,minlength[4],maxlength[18]"  />
                                        </div>
                                      
                                      
                                     <div class="form-group m-0">
                                        <label  class="col-form-label s-12">昵称</label>
                                        <input class="form-control r-0 light s-12"   value="{$data.nick_name}"  type="text" name="nick_name" >
                                    </div>
                                      
                                      
                                     <div class="form-group m-0">
                                        <label  class="col-form-label s-12">密码</label>
                                        <input class="form-control r-0 light s-12"  type="password" id="password" name="password" data-validate="minlength[4],maxlength[18]"  data-message-required="密码必填,长度最小为4个字符,最大为18个字符"   placeholder="******">
                                    </div>
                                    
                                     <div class="form-group m-0">
                                        <label  class="col-form-label s-12">确认密码</label>
                                        <input class="form-control r-0 light s-12"  type="password" name="_password"   data-validate="minlength[4],equalTo[#password],maxlength[18]" data-message-required="确认密码必填,长度最小为4个字符,最大为18个字符,并与密码一致"    placeholder="******">
                                    </div>


                                      
                                                                 
                                      
                                        <div class="form-row">
                                            <div class="form-group col-6 m-0">
                                                <label for="cnic" class="col-form-label s-12">权限</label>

                                              
                    <select name="power" id="ss" onchange="dai()"  class="custom-select my-1 mr-sm-2 form-control r-0 light s-12" >
                        <option value="1" onclick="dai()" {$data.power=='1'?'selected':''}>升级代理&nbsp;(需扣除{$daili_price}元)</option>
                        <option value="2" onclick="yong()" {$data.power=='2'?'selected':''}>用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;户</option>

                    </select>
                                              
                                              
                                            </div>
               
                              
                                        </div>           
                                      
                                      
                                      

       <?php if(session('power')=='0'){?>
                                                                
                                     <div class="form-group m-0" >
                                        <label  class="col-form-label s-12">积分</label>
                                        <input class="form-control r-0 light s-12"   value="{$data.sign}"     type="text" name="sign" >
                                    </div>
                                                                               
             
                                                                
                                                              
                                     <div class="form-group m-0"  id="phone" style="display: {$data.power=='1'?'block':'none'}">
                                        <label  class="col-form-label s-12">手机</label>
                                        <input class="form-control r-0 light s-12"   value="{$data.phone}"     type="tel" name="phone">
                                    </div>
                                                    
                                       
                                     <div class="form-group m-0" >
                                        <label  class="col-form-label s-12">微信</label>
                                        <input class="form-control r-0 light s-12"   value="{$data.weichat}"     type="text" name="weichat" >
                                    </div>
                                                           
                                      
                                      
                                     <div class="form-group m-0"  id="yue" style="display: {$data.power=='1'?'block':'none'}">
                                        <label  class="col-form-label s-12">余额</label>
                                        <input class="form-control r-0 light s-12"   value="{$data.money}"     type="text" name="money" >
                                    </div>
                      
                       
                               <!--        
                                     <div class="form-group m-0"  id="share_ma" style="display: {$data.power=='1'?'block':'none'}">
                                        <label  class="col-form-label s-12">推荐码</label>
                                        <input class="form-control r-0 light s-12"  name="share_ma" value="{$data.share_ma}"  placeholder="推荐码不能为汉字" >
                                    </div>-->
   
                    <?php } ?>                                  

                                    </div>

                                                
                                      <input type="hidden" name="id" value="{$data.id}">                         
                   <?php if(session('power')=='0'){?>                               
                                   <?php $zfb	=	db('user')->where('id',$data['id'])->value('zfb'); 
										$zfb_name	=	db('user')->where('id',$data['id'])->value('zfb_name'); 
									if(empty($zfb)){?>   
                                  <div class="col-md-3 offset-md-1">
                                   <div style=" max-height: 200px;  max-width: 200px;  border: 2px solid rgba(0,0,0,.3); background: #fff; padding: 5px 5px; border: 2px dashed #e1e8ee; ">
 										<span class="badge badge-Light"><i class="icon-qrcode"> </i> 收款账户</span>
 										<span class="badge"> 未设置 或 获取失败</span>
      								  </div>
                                    </div>
                                   <?php }else{ ?>
                             
                                                    <div class="col-md-3 offset-md-1">
      
                                                       <!--收款码-->
                                                       <span class="badge badge-Light"><i class="icon-qrcode"> </i> 收款账户 </span>  
                                                        <div style=" max-height: 200px;  max-width: 200px;  border: 2px solid rgba(0,0,0,.3); background: #fff; padding: 5px 5px; border: 2px dashed #e1e8ee; ">
                                                          <span class="badge">支付宝： {$zfb}  </span> <span class="badge">姓名： {$zfb_name}  </span>
                                                       
                                                        </div>
                                                      
                                                      </div>
                                  	<?php } ?>
    		 <?php } ?>  
                                </div>

                            </div>
         
                          
                          
                            <hr>
                            <div class="card-body">
         					 
                                <button type="submit" class="btn btn-primary btn-lg"><i class="icon-save mr-2"></i>确认修改</button>
                            </div>
                        </div>
                    </form>
                </div>
              
              
              
              
          <div class="col-md-5">
                                  <h3>会员信息编辑</h3>
                                  <hr>
                                  <p>1.尽量关闭浏览器记住账号密码等功能,以免自动添加造成误解.</p>
                                  <p>2.字符长度： 6 ≥  账户/密码  ≤ 18 .</p>

            
                                  <h4 class="mt-5">未完待续</h4>
                                  <hr>
                              </div>    
              
              
              
              
              
              
              
              
            </div>
    </div>
    </div>
    </div>
</div>




<script>
    function dai() {
        var ss= $('#ss').val();
        if(ss=='1')
        {
            $('#phone').css('display','block')
            $('#share_ma').css('display','block')
            $('#yue').css('display','block')
        }else{
            $('#phone').css('display','none')
            $('#share_ma').css('display','none')
            $('#yue').css('display','none')
        }
    }
</script>
{$code=='err1'?'
<div class="col-md-6">
    <div class="alert alert-danger" id="alert" style="position:fixed;right:0px;bottom:0px;  width: 350px">
        <button type="button" class="close" data-dismiss="alert">
            <span aria-hidden="true">×</span>
            <span class="sr-only">Close</span>
        </button>
        <strong> 糟糕 !</strong> 修改失败 .用户已存在
        .请重新修改
    </div>
</div>

':''}

{$code=='err3'?'
<div class="col-md-6">
    <div class="alert alert-danger" id="alert" style="position:fixed;right:0px;bottom:0px;  width: 350px">
        <button type="button" class="close" data-dismiss="alert">
            <span aria-hidden="true">×</span>
            <span class="sr-only">Close</span>
        </button>
        <strong> 糟糕 !</strong> 您的余额不足，请联系管理员充值
    </div>
</div>

':''}

{$code=='err4'?'
<div class="col-md-6">
    <div class="alert alert-danger" id="alert" style="position:fixed;right:0px;bottom:0px;  width: 350px">
        <button type="button" class="close" data-dismiss="alert">
            <span aria-hidden="true">×</span>
            <span class="sr-only">Close</span>
        </button>
        <strong> 糟糕 !</strong> 推荐码已存在
        .请重新添加
    </div>
</div>

':''}
{$code=='err2'?'
<div class="col-md-6">
    <div class="alert alert-danger" id="alert" style="position:fixed;right:0px;bottom:0px;  width: 350px">
        <button type="button" class="close" data-dismiss="alert">
            <span aria-hidden="true">×</span>
            <span class="sr-only">Close</span>
        </button>
        <strong> 糟糕 !</strong> 修改失败
        .请重新修改
    </div>
</div>

':''}
<script>
    setTimeout("$('#alert').fadeOut(1000)",2000)
</script>